/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.exam;

/**
 * <p>Project: javaseapp - Ex1
 * <p>Powered by webrx On 2021-08-07 11:26:50
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Ex1 {
    public static void main(String[] args) {
        String str = "abc123一二三";
        //方法一
        String s1 = "";
        for (int i = str.length() - 1; i >= 0; i--) {
            s1 += str.charAt(i);
        }
        System.out.println(s1);

        //方法二
        String s2 = "";
        for (int i = 0; i < str.length(); i++) {
            s2 = str.charAt(i) + s2;
        }
        System.out.println(s2);

        //方法三
        String s3 = new StringBuilder(str).reverse().toString();
        System.out.println(s3);

    }
}
